#!/bin/bash

# ----------------------------------------------------------------------
# Filename:   chkconfig-del-add.sh
# Version:    1.0
# Date:       2014/23/07
# Author:     jinzhao.wang	
# Email:      jinzhao.wang@cs2c.com.cn
# Summary:    02系统基本功能-02系统管理功能-16系统和系统服务管理-02服务配置工具chkconfig-03删除添加服务
# Notes:      chkconfig命令
# Copyright:  China Standard Software Co., Ltd.
# History：     
#             Version 1.0, 2013/12/02
#             -   The first one
#             Version 1.1, 2014/11/24
#             -   The second one;
#             -   Add SFROOT;
# ----------------------------------------------------------------------

if [ -z "$SFROOT" ]
then
    CMDLIB=./
    SFROOT=./
else
    CMDLIB=${SFROOT}/testcases/Management_Function/system_service_management
fi

. ${SFROOT}/lib/Echo.sh
. ${SFROOT}/lib/XmlParse.sh

LANG=en_US.UTF-8

echo $LANG

function CleanData ()
{
  EchoInfo "chkconfig-del-add.sh执行完毕"
}

trap "CleanData" EXIT INT
#确定系统已安装chkconfig软件包
EchoInfo "确定系统已安装chkconfig软件包"
rpm -q chkconfig
EchoInfo "系统安装了chkconfig软件包"
#删除httpd开机启动状态
chkconfig --del httpd
#查看httpd开机启动状态
! chkconfig --list  httpd
EchoResult "成功删除httpd服务"
#添加httpd服务
chkconfig --add httpd
chkconfig --list  httpd
EchoResult "成功添加httpd服务"
